<?php 
  /******************************************************************
    * Render categories menu *
  ******************************************************************/
class CategoryHelper extends AppHelper {
    function recursiveLoop($items){
    	$content = "<ul>";
    	foreach ($items as $item) {
    		$class = $class == '' ? 'altrow' : '';
    		$content .= "";
    		if (isset($item['items'])) {
    			$content .= "
    			<li>
    				<span class='folder field-name'>".$item['ProductCategory']['name']."</span>
    			</li>";
    		}
    		if (isset($item['items'])) {
    			$content .= $this->thisrecursiveLoop($item['items']);
    		}
    	}
    	$content = "</ul>";
    	return $content;
    }
}
?> 